<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * 剧本
 */
class Play extends Model
{
    use SoftDeletes;

    protected $table = 'plays';

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'user_id','category_id','title','description','thumb','first_image','logo','page_turn_way','is_cycle','is_auto','is_share','is_template','views','counts','wx_share_description','wx_share_image','wx_share_title','music_url'
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    // protected $hidden = ['user_id', 'is_share'];

    public function user()
    {
        return $this->belongsTo('App\Models\User');
    }

    public function category()
    {
        return $this->belongsTo('App\Models\PlayCategory','category_id','id');
    }

}
